<style type="text/css">
    .small-table .layui-form-checkbox[lay-skin=primary]{
        padding-right: 0!important;
        margin-top: -3px;
    }
    .small-table .layui-form-checkbox[lay-skin=primary] i{
        top: 0;
    }
</style>
<div style="padding: 5px 20px 20px" id="addBillContent">
    <form class="layui-form layui-user-from order-detail-tab" v-cloak>
        <!-- 项目新增候选人可以多选，可以不选 -->
        <!-- 订单必须要有候选人 -->
        <div class="layui-card">
            <div class="layui-card-header"><strong th:text="#{jobInvoiceBatch.invoice.title1}">项目/订单信息</strong></div>
            <div class="layui-card-body">
<!--                <div class="layui-row">-->
<!--                    <div class="layui-form-item">-->
<!--                        <label class="layui-form-label">&nbsp;</label>-->
<!--                        <div class="layui-input-block"><span class="layui-badge layui-bg-lightViolet">XID: 2342394234</span></div>-->
<!--                    </div>-->
<!--                </div>-->
                <div class="layui-row">
                    <div class="layui-col-md12">
                        <div class="layui-form-item">
                            <label class="layui-form-label" th:text="#{jobInvoiceBatch.invoice.billingType}">开票类型</label>
                            <div class="layui-input-inline" style="width: auto">
                                <input type="radio" name="billingType" lay-filter="billingType" v-model="form.billingType" lay-verify="required" value="0" th:title="#{jobInvoiceBatch.invoice.project}" title="项目">
                                <input type="radio" name="billingType" lay-filter="billingType" v-model="form.billingType" lay-verify="required" value="1" th:title="#{jobInvoiceBatch.invoice.order}" title="订单">
                            </div>
                        </div>
                    </div>
                </div>
                <div class="layui-row">
                    <div class="layui-col-md6" v-if="form.billingType == 0">
                        <div class="layui-form-item">
                            <label class="layui-form-label label-required" th:text="#{jobInvoiceBatch.invoice.project}">项目</label>
                            <div class="layui-input-block">
                                <div ref="projectSelect"></div>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="layui-row">
                    <div class="layui-col-md6" v-if="form.billingType == 1">
                        <div class="layui-form-item">
                            <label class="layui-form-label label-required" th:text="#{jobInvoiceBatch.invoice.order}">订单</label>
                            <div class="layui-input-block">
                                <div ref="orderSelect"></div>
                            </div>
                        </div>
                    </div>
                </div>

<!--                <div class="layui-row">-->
<!--                    <div class="layui-form-item">-->
<!--                        <label class="layui-form-label">XID</label>-->
<!--                        <div class="layui-input-block"><span class="layui-badge layui-bg-lightViolet">2342394234</span></div>-->
<!--                    </div>-->
<!--                </div>-->
                <!-- 候选人信息 -->
                <div class="layui-collapse" v-if="form.projectId || form.orderId">
                    <div class="result-msg color-gray" v-show="resultFlag" >
                        <i class="layui-icon layui-icon-loading  layui-anim layui-anim-rotate layui-anim-loop"></i>
                    </div>
                    <div class="result-msg color-gray" v-show="!resultFlag && !jobInvoiceVos.length" >
                        <p class="color-red" th:text="#{jobInvoiceBatch.invoice.tips1}">暂无候选人信息</p>
                    </div>
                    <talent-item ref="talentItem"
                                 v-for="(item, index) in jobInvoiceVos"
                                 :key="item.id"
                                 :data="item"
                                 :number="index"
                                 :charge-type="chargeType"
                                 :supplier="supplier"
                                 :receipt-type="receiptType"
                                 :distribution-Type="distributionType"
                                 :payment-data="paymentData"
                                 :addable="canSelectTalent.length > 0"
                                 :deleteable="jobInvoiceVos.length > 1"
                                 @add="handleAddBtnClick"
                                 @remove="handleDelete"></talent-item>
                </div>
            </div>
        </div>
        <!-- 内部信息 -->
        <div class="layui-card">
            <div class="layui-card-header"><strong th:text="#{jobInvoiceBatch.invoice.title2}">内部信息</strong></div>
            <div class="layui-card-body">
                <div class="layui-row">
                    <div class="layui-col-md6">
                        <div class="layui-form-item">
                            <label class="layui-form-label" th:text="#{jobInvoiceBatch.invoice.contract}">合同</label>
                            <div class="layui-input-inline" style="width: 300px">
                                <div ref="agreementSelect"></div>
                            </div>
                            <!-- <div class="layui-input-inline">
                                <a class="layui-btn layui-btn-xs layui-bg-lightblue">搜索</a>
                            </div> -->
                        </div>
                    </div>
                    <div class="layui-col-md6">
                        <div class="layui-form-item">
                            <label class="layui-form-label">PO</label>
                            <div class="layui-input-block">
                                <input type="text" name="poNumber" v-model="form.poNumber" placeholder="" autocomplete="off" class="layui-input">
                            </div>
                        </div>
                    </div>
                    <div class="layui-col-md6">
                        <div class="layui-form-item">
                            <label class="layui-form-label" th:text="#{jobInvoiceBatch.invoice.expressNumber}">快递单号</label>
                            <div class="layui-input-block">
                                <input type="text" name="expressNumber" v-model="form.expressNumber" placeholder="" autocomplete="off" class="layui-input">
                            </div>
                        </div>
                    </div>
                    <div class="layui-col-md6">
                        <div class="layui-form-item">
                            <label class="layui-form-label" th:text="#{jobInvoiceBatch.invoice.expressCompany}">快递公司</label>
                            <div class="layui-input-block">
                                <input type="text" name="expressCompany" v-model="form.expressCompany" placeholder="" autocomplete="off" class="layui-input">
                            </div>
                        </div>
                    </div>
                    <div class="layui-col-md6">
                        <div class="layui-form-item">
                            <label class="layui-form-label label-required">Payment Terms</label>
                            <div class="layui-input-block">
                                <div ref="paymentTerms"></div>
                                <!-- <select name="paymentTerms" v-model="form.paymentTerms" lay-filter="paymentTerms" lay-verify="required">
                                    <option value="">请选择</option>
                                    <option value="0">Nett 7 Days</option>
                                    <option value="1">Nett 22 Days</option>
                                    <option value="2">Nett 70 Days</option>
                                </select> -->
                            </div>
                        </div>
                    </div>
                    <div class="layui-col-md6">
                        <div class="layui-form-item">
                            <label class="layui-form-label" th:text="#{jobInvoiceBatch.invoice.invoiceNo}">税务发票号</label>
                            <div class="layui-input-block">
                                <input type="text" name="form.invoiceNo" v-model="form.invoiceNo" readonly class="layui-input layui-disabled">
                            </div>
                        </div>
                    </div>
                    <div class="layui-col-md12">
                        <div class="layui-form-item">
                            <label class="layui-form-label" th:text="#{jobInvoiceBatch.invoice.invoiceBillingType}">Invoice Type</label>
                            <div class="layui-input-inline" style="width: 300px">
                                <select name="invoiceBillingType" v-model="form.invoiceBillingType" lay-filter="invoiceType"   title="1">
                                    <option value=""  th:text="#{common.pleaseSelect}">请选择</option>
                                    <option v-for="item in invoiceType" :key="item.id" :value="item.text">{{item.text}}</option>
                                </select>
                            </div>
                        </div>
                    </div>
                    <div class="layui-col-md12">
                        <div class="layui-form-item">
                            <label class="layui-form-label" th:text="#{jobInvoiceBatch.invoice.printStatus}">打印状态</label>
                            <div class="layui-input-block">
                                <span class="layui-badge layui-bg-orange" v-if="form.printStatus == 0" th:text="#{jobInvoiceBatch.invoice.printStatus.no}">系统发票未打印</span>
                                <span class="layui-badge layui-bg-gray"  v-if="form.printStatus == 1" th:text="#{jobInvoiceBatch.invoice.printStatus.yes}">系统发票已打印</span>
                            </div>
                        </div>
                    </div>
                    <div class="layui-col-md12">
                        <div class="layui-form-item">
                            <label class="layui-form-label" th:text="#{jobInvoiceBatch.invoice.payStatus}">收款状态</label>
                            <div class="layui-input-block">
                                <span class="layui-badge layui-bg-orange" v-if="form.payStatus == 0" th:text="#{jobInvoiceBatch.invoice.payStatus.no}">税务发票未收款</span>
                                <span class="layui-badge layui-bg-lightblue" v-if="form.payStatus == 1" th:text="#{jobInvoiceBatch.invoice.payStatus.part}">税务发票部分收款</span>
                                <span class="layui-badge layui-bg-gray" v-if="form.payStatus == 2" th:text="#{jobInvoiceBatch.invoice.payStatus.all}">税务发票已收款</span>
                            </div>
                        </div>
                    </div>
                    <div class="layui-col-md12">
                        <div class="layui-form-item">
                            <label class="layui-form-label">Submit To Billing</label>
                            <div class="layui-input-block">
                                <input type="checkbox" name="submitToBilling" v-model="form.submitToBilling" lay-filter="submitToBilling" th:title="#{jobInvoiceBatch.invoice.submitToBilling}" title="是" lay-skin="primary">
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>

        <div class="layui-form-item layui-hide">
            <div class="layui-input-block">
                <a class="layui-btn" lay-submit lay-filter="billSub">立即提交</a>
                <a class="layui-btn" @click="handleSubmitBtnClick">立即提交</a>
            </div>
        </div>
    </form>
</div>
<!-- 候选人 -->
<script type="text/html" id="tplTalent">
    <div class="layui-colla-item">
        <h2 class="layui-colla-title">
            <div class="layui-row">
                <div class="layui-col-md6">
                    <strong>{{ form.talentNameCn || '&nbsp;' }}</strong>
                </div>
                <div class="layui-col-md6 text-right">
                    <a v-if="addable" class="layui-btn layui-btn-xs layui-btn-primary" @click.prevent.stop="handleAddBtnClick"><i class="fa fa-plus-circle"></i> <span th:text="#{jobInvoiceBatch.invoice.button.add}">新增</span></a>
                    <a v-if="deleteable" class="layui-btn layui-btn-xs layui-btn-primary" @click.prevent.stop="handleDelete"><i class="fa fa-trash"></i> <span th:text="#{jobInvoiceBatch.invoice.button.delete}">删除</span></a>
                </div>
            </div>
        </h2>
        <div class="layui-colla-content" :class="{'layui-show': number == 0}">
            <!-- 入职日期 -->
            <div class="layui-row">
                <div class="layui-col-md3">
                    <div class="layui-form-item">
                        <label class="layui-form-label" th:text="#{jobInvoiceBatch.invoice.onboardDate}">入职日期</label>
                        <div class="layui-input-block">
                            <input type="text"
                                   name="onboardDate"
                                   v-model="form.onboardDate"
                                   ref="onboardDate"
                                   placeholder=""
                                   autocomplete="off"
                                   readonly
                                   class="layui-input layui-disabled">
                        </div>
                    </div>
                </div>
                <div class="layui-col-md3">
                    <div class="layui-form-item">
                        <label class="layui-form-label" th:text="#{jobInvoiceBatch.invoice.guaranteePeriod}">保证期</label>
                        <div class="layui-input-block">
                            <input type="text" name="guaranteePeriod" v-model="form.guaranteePeriod" placeholder="" autocomplete="off" readonly class="layui-input layui-disabled">
                        </div>
                    </div>
                </div>
            </div>
            <div class="layui-divider mt-10 mb-20"></div>
            <!-- 收费信息 -->
            <div class="bi-item">
                <div class="bi-title">
                    <strong th:text="#{jobInvoiceBatch.invoice.billInfo}">收费信息</strong>
                    <strong class="pull-right"><span th:text="#{jobInvoiceBatch.invoice.billTotal}">收费总计</span>: <span class="color-red">¥ {{form.billAmount}}</span></strong>
                </div>
                <div class="mb-15">
                    <!-- 收费信息-->
                    <table class="layui-table">
                        <colgroup>
                            <col width="10%">
                            <col width="20%">
                            <col width="15%">
                            <col width="15%">
                            <col width="15%">
                            <col width="25%">
                        </colgroup>
                        <thead>
                        <tr>
                            <th class="label-required">调整类型</th>
                            <th class="label-required" th:text="#{jobInvoiceBatch.invoice.item}">科目</th>
                            <th class="label-required">账单调整金额</th>
                            <th>调整支出金额</th>
                            <th th:text="#{jobInvoiceBatch.invoice.distributionType}">供应商</th>
                            <th>调整理由 <a class="layui-btn layui-btn-xs layui-btn-primary pull-right" @click="handleAddCharge"><i class="fa fa-plus-circle"></i> <span th:text="#{jobInvoiceBatch.invoice.button.add}">新增</span></a></th>
                        </tr>
                        </thead>
                        <tbody>
                        <charge-item ref="chargeItem"
                                     v-for="item in chargeList"
                                     :key="item.id"
                                     :data="item"
                                     :charge-type="chargeType"
                                     :supplier="supplier"
                                     :deleteable="chargeList.length > 1"
                                     @income-change="handleIncomeAmountChange"
                                     @delete="handleDeleteCharge"></charge-item>
                        </tbody>
                    </table>
                </div>
                <div class="layui-row">
                    <div class="layui-col-md12">
                        <div class="layui-form-item">
                            <label class="layui-form-label" th:text="#{jobInvoiceBatch.invoice.receiptType}">收款比例</label>
                            <div class="layui-input-inline">
                                <!-- <select name="receiptType" v-model="form.receiptType" lay-filter="receiptType">
                                    <option value=""></option>
                                    <option value="0">全款</option>
                                    <option value="1">首款</option>
                                    <option value="2">尾款</option>
                                </select> -->
                                <select :name="'receiptType-' +  form.id" v-model="form.receiptType" lay-verify="required" :lay-filter="'receiptType-' +  form.id">
                                    <option value="" th:text="#{common.pleaseSelect}">请选择</option>
                                    <option v-for="item in receiptType" :key="item.id" :value="item.id">{{item.text}}</option>
                                </select>
                            </div>
                            <div class="layui-input-inline" style="width: 100px;">
                                <input-number v-model="form.receiptPercent" :min="0" :max="100"></input-number>
                            </div>
                            <div class="layui-form-mid">%</div>
                        </div>
                    </div>
                    <!-- <div class="layui-col-md12">
                        <div class="layui-form-item">
                            <label class="layui-form-label">Invoice Type</label>
                            <div class="layui-input-inline">
                                <select name="invoiceType" v-model="form.invoiceType" lay-filter="invoiceType">
                                    <option value=""></option>
                                    <option value="0">ManyToOne</option>
                                    <option value="1">OneByOne</option>
                                </select>
                                <select name="invoiceBillingType" v-model="form.invoiceBillingType" lay-filter="invoiceType">
                                    <option value="">请选择</option>
                                    <option v-for="item in invoiceType" :key="item.id" :value="item.id">{{item.text}}</option>
                                </select>
                            </div>
                        </div>
                    </div> -->
                    <div class="layui-col-md12">
                        <div class="layui-form-item">
                            <label class="layui-form-label label-required" th:text="#{jobInvoiceBatch.invoice.invoiceComment}">收费备注</label>
                            <div class="layui-input-block">
                                <textarea name="invoiceComment" lay-verify="required" v-model="form.invoiceComment" placeholder="" class="layui-textarea"></textarea>
                            </div>
                        </div>
                    </div>
                    <div class="layui-col-md12">
                        <div class="layui-form-item">
                            <label class="layui-form-label" th:text="#{jobInvoiceBatch.invoice.uploadFile}">上传附件</label>
                            <div class="layui-input-inline">
                                <button type="button" class="layui-btn layui-btn-xs layui-btn-primary" ref="uploadFile" th:text="#{jobInvoiceBatch.invoice.uploadFile}">上传附件</button>
                            </div>
                        </div>
                    </div>
                    <div class="layui-col-md12" v-if="fileList.length">
                        <div class="layui-form-item">
                            <label class="layui-form-label">&nbsp;</label>
                            <div class="layui-input-inline" style="width: 300px">
                                <ul class="clearfix annex-list" v-for="item in fileList" :key="item.id">
                                    <li>
                                        <div class="mr-20">
                                            <i class="fa fa-file mr-10"></i>
                                            <span class="color-blue" v-text="item.fileName"></span>
                                        </div>
                                        <a href="javascript:;" @click="handleDeleteFile(item.id)"><i class="fa fa-close"></i></a>
                                    </li>
                                </ul>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <div class="layui-divider mt-20 mb-20"></div>
            <!-- 业绩分配 -->
            <div class="bi-item">
                <div class="bi-title">
                    <strong th:text="#{jobInvoiceBatch.invoice.achievement}">业绩分配</strong>
                </div>
                <div class="pb-5">
                    <table class="layui-table">
                        <colgroup>
                            <col width="15%">
                            <col width="15%">
                            <col width="25%">
                            <col width="45%">
                        </colgroup>
                        <thead>
                        <tr>
                            <th th:text="#{jobInvoiceBatch.invoice.user}">用户</th>
                            <th th:text="#{jobInvoiceBatch.invoice.role}">角色</th>
                            <th class="label-required" th:text="#{jobInvoiceBatch.invoice.revenueSplit}">Revenue Split</th>
                            <th class="label-required"><span th:text="#{jobInvoiceBatch.invoice.reasonType}">分成原因</span> <a v-if="canSelectUsers.length" class="layui-btn layui-btn-xs layui-btn-primary pull-right" @click="handleAddAchievement"><i class="fa fa-plus-circle"></i> <span th:text="#{jobInvoiceBatch.invoice.button.add}">新增</span></a></th>
                        </tr>
                        </thead>
                        <tbody>
                        <achievement-item ref="achievementItem"
                                          v-for="item in achievementList"
                                          :invoice-amount="form.billAmount"
                                          :distribution-type="distributionType"
                                          :key="item.id"
                                          :data="item"
                                          :deleteable="achievementList.length > 1"
                                          @delete="handleDeleteAchievement"></achievement-item>
                        </tbody>
                    </table>
                </div>
            </div>
            <div class="layui-divider mt-20 mb-20"></div>
            <!-- 客户信息 -->
            <div class="bi-item">
                <div class="bi-title">
                    <strong th:text="#{jobInvoiceBatch.invoice.customerInfo}">客户信息</strong>
                </div>
                <div class="pb-5">
                    <div class="layui-row">
                        <div class="layui-col-md12">
                            <div class="layui-form-item">
                                <label class="layui-form-label label-required" th:text="#{jobInvoiceBatch.invoice.paymentInfo}">付款信息</label>
                                <div class="layui-input-inline" style="width: 300px">
                                    <div ref="paymentSelect"></div>
                                </div>
                                <div class="layui-input-inline layui-hide">
                                    <a class="layui-btn layui-btn-xs layui-btn-primary" :class="{'layui-disabled': !form.clientBillingNumber}" @click="editPaymentInfo"><span>编辑</span></a>
                                    <a class="layui-btn layui-btn-xs layui-bg-lightblue" @click="addPaymentInfo">添加</a>
                                </div>

                                <!-- 付款信息详情 -->
                                <div class="layui-input-block layui-clear pt-10" v-if="form.clientBillingNumber">
                                    <!-- 发票信息 -->
                                    <div class="layui-card">
                                        <div class="layui-card-header"><strong th:text="#{jobInvoiceBatch.invoice.payInfo.invoiceTitle}">发票信息</strong></div>
                                        <div class="layui-card-body">
                                            <div class="layui-row">
                                                <div class="layui-col-md6">
                                                    <div class="order-basic-item">
                                                        <div class="label" th:text="#{jobInvoiceBatch.invoice.payInfo.billingType}">发票类型</div>
                                                        <div class="info" v-text="payInfo.billingType"></div>
                                                    </div>
                                                </div>
                                                <div class="layui-col-md6">
                                                    <div class="order-basic-item">
                                                        <div class="label" th:text="#{jobInvoiceBatch.invoice.payInfo.invoiceTitle}">发票抬头</div>
                                                        <div class="info" v-text="payInfo.invoiceTitle"></div>
                                                    </div>
                                                </div>
                                                <div class="layui-col-md6">
                                                    <div class="order-basic-item">
                                                        <div class="label" th:text="#{jobInvoiceBatch.invoice.payInfo.clientTaxCode}">纳税人识别号</div>
                                                        <div class="info" v-text="payInfo.clientTaxCode"></div>
                                                    </div>
                                                </div>
                                                <div class="layui-col-md6">
                                                    <div class="order-basic-item">
                                                        <div class="label" th:text="#{jobInvoiceBatch.invoice.payInfo.registerAddress}">税务登记地址</div>
                                                        <div class="info" v-text="payInfo.registerAddress"></div>
                                                    </div>
                                                </div>
                                                <div class="layui-col-md6">
                                                    <div class="order-basic-item">
                                                        <div class="label" th:text="#{jobInvoiceBatch.invoice.payInfo.registerPhone}">税务登记电话</div>
                                                        <div class="info" v-text="payInfo.registerPhone"></div>
                                                    </div>
                                                </div>
                                                <div class="layui-col-md6">
                                                    <div class="order-basic-item">
                                                        <div class="label" th:text="#{jobInvoiceBatch.invoice.payInfo.bankAccountName}">开户银行名称</div>
                                                        <div class="info" v-text="payInfo.bankAccountName"></div>
                                                    </div>
                                                </div>
                                                <div class="layui-col-md6">
                                                    <div class="order-basic-item">
                                                        <div class="label" th:text="#{jobInvoiceBatch.invoice.payInfo.bankAccountCode}">开户银行账号</div>
                                                        <div class="info" v-text="payInfo.bankAccountCode"></div>
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    <!-- 快递信息 -->
                                    <div class="layui-card">
                                        <div class="layui-card-header"><strong th:text="#{jobInvoiceBatch.invoice.payInfo.expressInfo}">快递信息</strong></div>
                                        <div class="layui-card-body">
                                            <div class="layui-row">
                                                <div class="layui-col-md6">
                                                    <div class="order-basic-item">
                                                        <div class="label" th:text="#{jobInvoiceBatch.invoice.payInfo.contactName}">收件人</div>
                                                        <div class="info" v-text="payInfo.contact.contactName"></div>
                                                    </div>
                                                </div>
                                                <div class="layui-col-md6">
                                                    <div class="order-basic-item">
                                                        <div class="label" th:text="#{jobInvoiceBatch.invoice.payInfo.contactTitle}">职务</div>
                                                        <div class="info" v-text="payInfo.contact.contactTitle"></div>
                                                    </div>
                                                </div>
                                                <div class="layui-col-md6">
                                                    <div class="order-basic-item">
                                                        <div class="label" th:text="#{jobInvoiceBatch.invoice.payInfo.mobile}">手机</div>
                                                        <div class="info" v-text="payInfo.contact.mobile"></div>
                                                    </div>
                                                </div>
                                                <div class="layui-col-md6">
                                                    <div class="order-basic-item">
                                                        <div class="label" th:text="#{jobInvoiceBatch.invoice.payInfo.email}">邮件</div>
                                                        <div class="info" v-text="payInfo.contact.email"></div>
                                                    </div>
                                                </div>
                                                <!-- <div class="layui-col-md6">
                                                    <div class="order-basic-item">
                                                        <div class="label">城市</div>
                                                        <div class="info"></div>
                                                    </div>
                                                </div> -->
                                                <div class="layui-col-md6">
                                                    <div class="order-basic-item">
                                                        <div class="label" th:text="#{jobInvoiceBatch.invoice.payInfo.address}">地址</div>
                                                        <div class="info" v-text="payInfo.contact.address"></div>
                                                    </div>
                                                </div>
                                                <!-- <div class="layui-col-md6">
                                                    <div class="order-basic-item">
                                                        <div class="label">邮编</div>
                                                        <div class="info"></div>
                                                    </div>
                                                </div> -->
                                                <div class="layui-col-md6">
                                                    <div class="order-basic-item">
                                                        <div class="label" th:text="#{jobInvoiceBatch.invoice.payInfo.clientName}">客户</div>
                                                        <div class="info" v-text="payInfo.contact.clientName"></div>
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    <!-- 其它信息 -->
                                    <div class="layui-card">
                                        <div class="layui-card-header"><strong th:text="#{jobInvoiceBatch.invoice.payInfo.otherInfo}">其它信息</strong></div>
                                        <div class="layui-card-body">
                                            <div class="layui-row">
                                                <div class="layui-col-md6">
                                                    <div class="order-basic-item">
                                                        <div class="label" th:text="#{jobInvoiceBatch.invoice.payInfo.id}">ID</div>
                                                        <div class="info" v-text="payInfo.id"></div>
                                                    </div>
                                                </div>
                                                <div class="layui-col-md6">
                                                    <div class="order-basic-item">
                                                        <div class="label" th:text="#{jobInvoiceBatch.invoice.payInfo.BillingNo}">Billing No.</div>
                                                        <div class="info" v-text="payInfo.dataSourceCode"></div>
                                                    </div>
                                                </div>
                                                <div class="layui-col-md6">
                                                    <div class="order-basic-item">
                                                        <div class="label" th:text="#{jobInvoiceBatch.invoice.payInfo.createBy}">添加者</div>
                                                        <div class="info" v-text="payInfo.createBy"></div>
                                                    </div>
                                                </div>
                                                <div class="layui-col-md6">
                                                    <div class="order-basic-item">
                                                        <div class="label" th:text="#{jobInvoiceBatch.invoice.payInfo.createTime}">添加日期</div>
                                                        <div class="info" v-text="payInfo.createTime"></div>
                                                    </div>
                                                </div>
                                                <div class="layui-col-md6">
                                                    <div class="order-basic-item">
                                                        <div class="label" th:text="#{jobInvoiceBatch.invoice.payInfo.modifyBy}">最近更新者</div>
                                                        <div class="info" v-text="payInfo.modifyBy"></div>
                                                    </div>
                                                </div>
                                                <div class="layui-col-md6">
                                                    <div class="order-basic-item">
                                                        <div class="label" th:text="#{jobInvoiceBatch.invoice.payInfo.modifyTime}">最近更新时间</div>
                                                        <div class="info" v-text="payInfo.modifyTime"></div>
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</script>
<script type="text/html" id="tplCanSelectTalent">
    <div class="dialog-wrap">
        <form class="layui-form">
            <table class="layui-table small-table" lay-size="sm" lay-skin="line">
                <colgroup>
                    <col width="20">
                    <col width="200">
                    <col>
                </colgroup>
                <thead>
                <tr>
                    <th></th>
                    <th th:text="#{jobInvoiceBatch.invoice.orderId}">订单ID</th>
                    <th th:text="#{jobInvoiceBatch.invoice.name}">姓名</th>
                </tr>
                </thead>
                <tbody>
                {{#  layui.each(d, function(index, item){ }}
                <tr>
                    <td>
                        <input type="checkbox" name="talentCb" title="" lay-skin="primary" lay-filter="talentCb" value="{{item.talentId}}">
                    </td>
                    <td>{{item.orderId}}</td>
                    <td>{{item.talentNameCn}}</td>
                </tr>
                {{#  }); }}
                </tbody>
            </table>
            <div class="layui-form-item layui-hide">
                <div class="layui-input-block">
                    <button class="layui-btn" lay-submit lay-filter="formSub">立即提交</button>
                </div>
            </div>
        </form>
    </div>
</script>
<!-- 收费信息 -->
<script type="text/html" id="tplCharge">
    <tr>
        <td>
            <div class="layui-input-inline">DN</div>
        </td>
        <td>
            <div class="layui-input-inline"  style="width: 250px">
                <div ref="chargeTypeSelect"></div>
            </div>
        </td>
        <td>
            <div class="layui-input-inline">
                <input-number v-model="form.billAmount" lay-verify="required" :precision="2" @change="handleIncomeAmountChange"></input-number>
            </div>
        </td>
        <td>
            <div class="layui-input-inline">
                <input type="text" name="payAmount" v-model="form.payAmount" placeholder="" @blur="handleAmountBlur" autocomplete="off" class="layui-input">
            </div>
        </td>
        <td>
            <div class="layui-input-inline" style="width: 250px">
                <div class="xm-pos-r" ref="supplierSelect"></div>
            </div>
        </td>
        <!-- 调整理由 -->
        <td>
            <div class="layui-input-inline" style="width: 250px">
                <div class="xm-pos-r" ref="supplierSelect"></div>
            </div>
        </td>
        <td>
            <div>
                <a class="layui-btn layui-btn-xs layui-btn-primary pull-right" @click="handleDeleteCharge" v-if="deleteable"><i class="fa fa-trash"></i> <span th:text="#{jobInvoiceBatch.invoice.button.delete}">删除</span></a></a>
            </div>
        </td>
    </tr>
</script>
<!--业绩分配-->
<script type="text/html" id="achievement">
    <tr>
        <td v-text="form.distributionUserEnglishName"></td>
        <td v-text="form.participantType"></td>
        <td>
            <div class="layui-input-inline" style="width: 60px">
                <input-number v-model="form.distributionProportion" placeholder="%" :min="0" :max="100"></input-number>
            </div>
            <div class="layui-form-mid" style="float: none; display: inline-block;">%</div>
            <div class="layui-input-inline" style="width: 100px">
                <input-number v-model="form.distributionAmount" placeholder="￥" :min="0" :max="invoiceAmount" :precision="2"></input-number>
                <!-- <input type="text" name="distributionAmount" placeholder="￥" autocomplete="off" class="layui-input" v-model="form.distributionAmount"> -->
            </div>
        </td>
        <td>
            <div class="layui-input-inline" style="width: 30%">
                <!--                <select name="reasonType" v-model="form.reasonType" lay-filter="reasonType" lay-verify="required">-->
                <!--                    <option value="">请选择</option>-->
                <!--                    <option value="0">Client Ownership分成</option>-->
                <!--                    <option value="1">Candidate Ownership分成</option>-->
                <!--                    <option value="3">离职顾问分成</option>-->
                <!--                    <option value="4">项目合作分成</option>-->
                <!--                    <option value="5">其他</option>-->
                <!--                </select>-->

                <select :name="'distributionType-' + form.id" v-model="form.distributionType" lay-verify="required" :lay-filter="'distributionType-' + form.id">
                    <option value=""  th:text="#{common.pleaseSelect}">请选择</option>
                    <option v-for="item in distributionType" :key="item.id" :value="item.id">{{item.text}}</option>
                </select>
            </div>
            <div class="layui-input-inline" style="width: 60%" v-if="form.distributionType == 5">
                <input type="text" name="reasonText" v-model="form.reasonText" lay-verify="required" placeholder="" autocomplete="off" class="layui-input">
            </div>
            <a class="layui-btn layui-btn-xs layui-btn-primary pull-right" @click="handleDeleteAchievement" v-if="deleteable && form.editable !== 0"><i class="fa fa-trash"></i> <span th:text="#{jobInvoiceBatch.invoice.button.delete}">删除</span></a></a>
        </td>
    </tr>
</script>
<!-- 角色 -->
<script type="text/html" id="tplCanSelectUser">
    <div class="dialog-wrap">
        <form class="layui-form">
            <table class="layui-table small-table" lay-size="sm" lay-skin="line">
                <colgroup>
                    <col width="20">
                    <col width="100">
                    <col width="200">
                    <col>
                </colgroup>
                <thead>
                <tr>
                    <th></th>
                    <th th:text="#{jobInvoiceBatch.invoice.userId}">用户ID</th>
                    <th th:text="#{jobInvoiceBatch.invoice.name}">姓名</th>
                    <th th:text="#{jobInvoiceBatch.invoice.role}">角色</th>
                </tr>
                </thead>
                <tbody>
                {{#  layui.each(d, function(index, item){ }}
                <tr>
                    <td>
                        <input type="checkbox" name="userCb" title="" lay-skin="primary" lay-filter="userCb" value="{{item.userId}}">
                    </td>
                    <td>{{item.userId}}</td>
                    <td>{{item.distributionUserEnglishName}}</td>
                    <td>{{item.participantType}}</td>
                </tr>
                {{#  }); }}
                </tbody>
            </table>
            <div class="layui-form-item layui-hide">
                <div class="layui-input-block">
                    <button class="layui-btn" lay-submit lay-filter="formSub">立即提交</button>
                </div>
            </div>
        </form>
    </div>
</script>
<script src="js/addBill.js"></script>
